import { createRouter, createWebHistory } from 'vue-router'
export const leftMenuRouter = [
    {
        path: '/dataOverview',
        name: '数据概览',
        component: () => import('@/views/dataOverview/index.vue')
    },
    {
        path: '/liveMonitor',
        name: '实况监测',
        component: () => import('@/views/liveMonitor/index.vue')
    }
]
export const rightMenuRouter = [
    {
        path: '/warnInfo',
        name: '预警信息',
        component: () => import('@/views/warnInfo/index.vue')
    },
    {
        path: '/forecastPredict',
        name: '预报预测',
        component: () => import('@/views/forecastPredict/index.vue')
    }
]
const routes = [
    {
        path: '/',
        name: 'Layout',
        component: () => import('@/views/layout/index.vue'),
        children: [...leftMenuRouter, ...rightMenuRouter],
        redirect: '/dataOverview'
    }
]

const router = createRouter({
    strict: true,
    history: createWebHistory(import.meta.env.VITE_BASE_PATH),
    routes
})
export const setupRouter = app => {
    app.use(router)
}
export default router
